package com.qc31.monitorlib.base

import com.qc31.monitorlib.R
import com.qc31.monitorlib.common.ChooseTimeViewModel

/**
 *@Author Jasper
 *@Time   2020/12/8
 *@Desc   查询基类
 */
open class BaseReportViewModel(
    var isSimple: Boolean = false,
    var isThirty: Boolean = false,
    var isSimpleThirty: Boolean = false,
    var toast: Int = R.string.hint_toast_choose_car
) : ChooseTimeViewModel(isSimple, isThirty,isSimpleThirty) {
    var carId = ""
    var carName = ""
    fun isParamOk(startTime: String, endTime: String) {
        if (carId.isEmpty()) {
            toast(toast)
            return
        }
        if (isParamsOk()) return
        if (isTimeOk(startTime, endTime)) return
        getData(carId, startTime, endTime)
    }

    open fun isParamsOk(): Boolean = false

    open fun getData(carId: String, startTime: String, endTime: String) {

    }
}